<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>函数</title>
		<script type="text/javascript">
			var add = function(a,b){
				alert(parseInt(a) + parseInt(b));
			}
		</script>
	</head>
	<body>
		<input type="number" class="js" name="num1" id="num1" value="" />
		<input type="number" class="js" name="num2" id="num2" value="" />
		<input type="button" onclick="add(num1.value,num2.value)" name="" id="" value="计算" />
	</body>
</html>